#include "UserInterfaceTest.h"
#include "UserInterface.h"

CPPUNIT_TEST_SUITE_REGISTRATION(UserInterfaceTest);

void UserInterfaceTest::testPromptUser() {
	*this->stimulsStream << "restart" << endl;
	string actual = UserInterface::promptUser(
		"Enter your move (L=left, R-right, U=up, D=down): ");

	ostringstream expected;
	expected << "restart";

	CPPUNIT_ASSERT_EQUAL(expected.str(), actual);
}

void UserInterfaceTest::testValidName() {
	CPPUNIT_ASSERT(UserInterface::validName("Bay Ivan"));
}

void UserInterfaceTest::testInvalidName() {
	CPPUNIT_ASSERT(! UserInterface::validName(""));
}

